// MMORPG游戏状态类型定义

// 游戏状态枚举
export const GAME_STATES = {
  IDLE: 'IDLE',           // 闲置状态
  EXPLORATION: 'EXPLORATION', // 探索状态
  COMBAT: 'COMBAT',       // 战斗状态
  DIALOGUE: 'DIALOGUE',   // 对话状态
  TRADING: 'TRADING',     // 交易状态
  MENU: 'MENU',           // 菜单状态
  CHARACTER_PANEL: 'CHARACTER_PANEL', // 角色面板状态
  INVENTORY: 'INVENTORY', // 物品栏状态
  DEATH: 'DEATH'          // 死亡状态
} as const;

export type GameState = typeof GAME_STATES[keyof typeof GAME_STATES];

// 状态转换条件类型
export interface Transition {
  to: GameState;
  condition: () => boolean;
}

// 状态行为类型
export interface StateActions {
  enter?: () => void;
  update?: () => void;
  exit?: () => void;
}

// 状态转换映射类型
export interface TransitionMap {
  [key: string]: Transition[];
}

// 状态行为映射类型
export interface StateActionMap {
  [key: string]: StateActions;
}

// 游戏数据初始化类型
export interface GameData {
  initialState?: GameState;
  playerData?: any;
  worldData?: any;
}

// 游戏状态快照类型
export interface GameStateSnapshot {
  currentState: GameState;
  availableStates: GameState[];
  possibleTransitions: GameState[];
}

// 鼠标位置类型
export interface MousePosition {
  x: number;
  y: number;
}

// 状态变化回调类型
export type StateChangeCallback = (fromState: GameState, toState: GameState) => void;